import request from "@/utils/request";

// 获取防疫地图列表
export function getDisinfectMap(params) {
  return request({
    url: "/robot-disinfect-map/v1/list",
    method: "get",
    params: params,
  });
}

// 删除防疫地图
export function getDisinfectMapById(id) {
  return request({
    url: "/robot-disinfect-map/v1/list/" + id,
    method: "get",
  });
}

// 删除防疫地图
export function deleteDisinfectMap(id) {
  return request({
    url: "/robot-disinfect-map/v1/" + id,
    method: "delete",
  });
}

// 创建防疫地图
export function createDisinfectMap(data) {
  return request({
    url: "/robot-disinfect-map/v1/add",
    method: "post",
    data: data,
  });
}

// 更新防疫地图
export function updateDisinfectMap(id, data) {
  return request({
    url: "/robot-disinfect-map/v1/update",
    method: "put",
    data: data,
  });
}

// 上传防疫地图
export function uploadImg(params) {
  return request({
    url: "/file/upload",
    method: "post",
    params: params,
  });
}

// 创建防疫区域
export function createDisinfectArea(data) {
  return request({
    url: "/robot-disinfect-area/v1/add",
    method: "post",
    data: data,
  });
}

// 获取防疫区域
export function getDisinfectArea(params) {
  return request({
    url: "/robot-disinfect-area/v1/list",
    method: "get",
    params: params,
  });
}

// 删除防疫区域
export function deleteDisinfectArea(id) {
  return request({
    url: "/robot-disinfect-area/v1/" + id,
    method: "delete",
  });
}

// 创建防疫路径
export function createDisinfectPath(data) {
  return request({
    url: "/robot-disinfect-route/v1/add",
    method: "post",
    data: data,
  });
}

// 获取防疫路径
export function getDisinfectPath(params) {
  return request({
    url: "/robot-disinfect-route/v1/list",
    method: "get",
    params: params,
  });
}

// 删除防疫路径
export function deleteDisinfectPath(id) {
  return request({
    url: "/robot-disinfect-route/v1/" + id,
    method: "delete",
  });
}

export const disinfectCharge = {
  get() {
    return request({
      url: "/robot-disinfect-charge-point/v1/list",
      method: "get",
    });
  },
  getOne(mid) {
    return request({
      url: "/robot-disinfect-charge-point/v1/getListByMid/" + mid,
      method: "get",
    });
  },
  create(data) {
    return request({
      url: "/robot-disinfect-charge-point/v1/create",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/robot-disinfect-charge-point/v1/update",
      method: "put",
      data,
    });
  },
  delete(id) {
    return request({
      url: "/robot-disinfect-charge-point/v1/delete/" + id,
      method: "delete",
    });
  },
};

export function getMap(id) {
  return request({
    url: "/robot-disinfect-map/v1/" + id,
    method: "get",
  });
}
